/// id : 4
/// sampleNo : "1123"
/// destroyedDate : "2022-10-10 00:00:00"
/// sterDate : "2022-10-10 00:00:00"
/// sampleDate : "2022-10-10 00:00:00"
/// details : [{"id":6,"label":"11","category":"2","sampleVolume":"6.000","foodName":"馒头","attachList":[4897]}]

class FoodSampleSubmitData {
  FoodSampleSubmitData({
      this.id, 
      this.sampleNo, 
      this.destroyedDate, 
      this.sterDate, 
      this.sampleDate, 
      this.details,});

  FoodSampleSubmitData.fromJson(dynamic json) {
    id = json['id'];
    sampleNo = json['sampleNo'];
    destroyedDate = json['destroyedDate'];
    sterDate = json['sterDate'];
    sampleDate = json['sampleDate'];
    if (json['details'] != null) {
      details = [];
      json['details'].forEach((v) {
        details?.add(FoodSampleSubmitDetail.fromJson(v));
      });
    }
  }
  num? id;
  String? sampleNo;
  String? destroyedDate;
  String? sterDate;
  String? sampleDate;
  List<FoodSampleSubmitDetail>? details;
FoodSampleSubmitData copyWith({  num? id,
  String? sampleNo,
  String? destroyedDate,
  String? sterDate,
  String? sampleDate,
  List<FoodSampleSubmitDetail>? details,
}) => FoodSampleSubmitData(  id: id ?? this.id,
  sampleNo: sampleNo ?? this.sampleNo,
  destroyedDate: destroyedDate ?? this.destroyedDate,
  sterDate: sterDate ?? this.sterDate,
  sampleDate: sampleDate ?? this.sampleDate,
  details: details ?? this.details,
);
  Map<String, dynamic> toJson() {
    final map = <String, dynamic>{};
    map['id'] = id;
    map['sampleNo'] = sampleNo;
    map['destroyedDate'] = destroyedDate;
    map['sterDate'] = sterDate;
    map['sampleDate'] = sampleDate;
    if (details != null) {
      map['details'] = details?.map((v) => v.toJson()).toList();
    }
    map.removeWhere((key, value) => value==null);
    return map;
  }

}

/// id : 6
/// label : "11"
/// category : "2"
/// sampleVolume : "6.000"
/// foodName : "馒头"
/// attachList : [4897]

class FoodSampleSubmitDetail {
  FoodSampleSubmitDetail({
      this.id, 
      this.label, 
      this.category, 
      this.sampleVolume, 
      this.foodName, 
      this.attachList,this.categoryName});

  FoodSampleSubmitDetail.fromJson(dynamic json) {
    id = json['id'];
    label = json['label'];
    category = json['category'];
    categoryName = json['categoryName'];
    sampleVolume = json['sampleVolume'];
    foodName = json['foodName'];
    attachList = json['attachList'] != null ? json['attachList'].cast<num>() : [];
  }
  num? id;
  String? label;
  String? category;
  String? categoryName;
  String? sampleVolume;
  String? foodName;
  List<num>? attachList;
FoodSampleSubmitDetail copyWith({  num? id,
  String? label,
  String? category,
  String? categoryName,
  String? sampleVolume,
  String? foodName,
  List<num>? attachList,
}) => FoodSampleSubmitDetail(  id: id ?? this.id,
  label: label ?? this.label,
  category: category ?? this.category,
  sampleVolume: sampleVolume ?? this.sampleVolume,
  foodName: foodName ?? this.foodName,
  attachList: attachList ?? this.attachList,
    categoryName:categoryName??this.categoryName
);
  Map<String, dynamic> toJson() {
    final map = <String, dynamic>{};
    map['id'] = id;
    map['label'] = label;
    map['category'] = category;
    map['sampleVolume'] = sampleVolume;
    map['foodName'] = foodName;
    map['attachList'] = attachList;
    map.removeWhere((key, value) => value==null);
    return map;
  }

}